#!/sbin/openrc-run

extra_started_commands="save"

description_save="Store in-memory logbook to disk"

pidfile="/run/$RC_SVCNAME.pid"
command="/usr/bin/logbookd"
command_args="-p $pidfile $LOGBOOKD_OPTS"

depend() {
	need hostname localmount
	use clock
	before net
	provide logger
}

save() {
	ebegin "Sending the save signal to the logbookd daemon"
	start-stop-daemon --signal USR1 --pidfile "$pidfile"
	eend $?
}
